<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        $(function(){
            $('#btn1').click(function(){
                console.log(111);
            })

            // $('#btn2').on('click',function(){
            $('#btn2').on('mouseover',function(){
                console.log(222);
            })
        })
    </script>
</head>
<body>
    <button id="btn1">方式1</button>
    <button id="btn2">方式2</button>
</body>
</html>